﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _4591BRD
{
    class GameObject
    {
        private Dictionary<string, float> _Data = null;
        public Dictionary<string, float> Data
        {
            get
            {
                if (_Data == null)
                    _Data = new Dictionary<string, float>();
                return _Data;
            }
        }
        //ObjectType: 0-unknow; 1-weapon; 2-vehicle; 3-vhicleweapon;
        private int _ObjectType = 0;
        public int ObjectType
        {
            get { return _ObjectType; }
            set { _ObjectType = value; }
        }
        private Int64 _ObjectID = 0;
        public Int64 ObjectID
        {
            get { return _ObjectID; }
            set { _ObjectID = value; }
        }
        private int _ProductID = 0;
        public int ProductID
        {
            get { return _ProductID; }
            set { _ProductID = value; }
        }
        private Int64 _ParentID = 0;
        public Int64 ParentID
        {
            get { return _ParentID; }
            set { _ParentID = value; }
        }
        private string _ClassName = "";
        public string ClassName
        {
            get { return _ClassName; }
            set { _ClassName = value; }
        }
        private string _ObjectName = "";
        public string ObjectName
        {
            get { return _ObjectName; }
            set { _ObjectName = value; }
        }
        private string _ProductName = "";
        public string ProductName
        {
            get { return _ProductName; }
            set { _ProductName = value; }
        }
        private string _XMLString = "";
        public string XMLString
        {
            get { return _XMLString; }
            set { _XMLString = value; }
        }

        //军团战绩
        private Dictionary<string, int> _TeamData = new Dictionary<string, int>();
        public Dictionary<string, int> TeamData
        {
            get { return _TeamData; }
        }

        public void AddTeamValue(string key, int value)
        {
            lock (_TeamData)
            {
                if (!_TeamData.ContainsKey(key))
                    _TeamData.Add(key, value);
                else
                    _TeamData[key] += value;
            }
        }
        public int GetTeamValue(string key)
        {
            lock (_TeamData)
            {
                if (!_TeamData.ContainsKey(key))
                    _TeamData.Add(key, 0);
                return _TeamData[key];
            }
        }
        //活跃成员
        private Dictionary<int, int> _ActMember = new Dictionary<int, int>();
        public Dictionary<int, int> ActMember
        {
            get { return _ActMember; }
        }

        public void AddActMember(int key, int value)
        {
            lock (_ActMember)
            {
                if (!_ActMember.ContainsKey(key))
                    _ActMember.Add(key, value);
                else
                    _ActMember[key] += value;
            }
        }
        public int GetActMember(int key)
        {
            lock (_ActMember)
            {
                if (!_ActMember.ContainsKey(key))
                    _ActMember.Add(key, 0);
                return _ActMember[key];
            }
        }
    }
}
